//
//  UIButton+MyButton.m
//  99QiangBa
//
//  Created by 张艳江 on 16/11/7.
//  Copyright © 2016年 zhangyanjiang. All rights reserved.
//

#import "UIButton+MyButton.h"

@implementation UIButton (MyButton)

+(UIButton *)createButtonFrame:(CGRect)frame groundColor:(UIColor *)groundColor title:(NSString *)title titleColor:(UIColor *)color font:(UIFont *)font target:(id)target action:(SEL)action{

    UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame=frame;
    [btn setBackgroundColor:groundColor];
    btn.titleLabel.font=font;
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];

    return btn;
}
+(UIButton *)createButtonFrame:(CGRect)frame backImageName:(NSString *)imageName target:(id)target action:(SEL)action{

    UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame=frame;
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return btn;
}

@end
